package com.mini.game.bus.event;

import com.mini.game.ApplicationContextProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 小鱼儿
 * @date 2020/9/2 9:51
 */
public class GameEventPublisher {
    private final static Logger logger = LoggerFactory.getLogger(GameEventPublisher.class);

    public final static <T> void publishEvent(T t) {
        try {
            ApplicationContextProvider.getApplicationContext().publishEvent(t);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
}
